<!--
 * @Author: your name
 * @Date: 2019-06-30 19:42:26
 * @LastEditTime: 2021-11-29 00:38:27
 * @LastEditors: your name
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \background-front\src\views\articleShow.vue
-->
<template>
    <el-card class="box-card">
        <div slot="header" class="clearfix" style="font-family:BlinkMacSystemFont,'Segoe UI',Helvetica,Arial,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-size: 20px">
            <span>{{title}}</span>
            <span style="float: right;width: 300px;" > 作者: 郑才育</span>
        </div>
        <div  class="text item">
            <mavon-editor :navigation=true :subfield=false style="height: 900px" v-model="content" />
        </div>
    </el-card>
</template>
<style scoped>
    .box-card{
        width: 70%;
        margin-left: 15%;
    }
</style>
<script>
    import Cookie from 'js-cookie'
    import ajax from "../api/ajax";

    export default {
        name: "articleShow",
        data() {
            return {
                id : this.$route.params['id'],
                title: "",
                author: "",
                time: "",
                content: ""
            }
        },
        methods: {
        },
        created(){
            console.log("article",this.$route.params.id);
            let url = '/article/' + this.id;
            ajax.get(url).then(
                resp => {
                    console.log(resp.data.Data);
                    this.title = resp.data.Data.title;
                    this.author = resp.data.Data.author;
                    this.content =  resp.data.Data.content;
            }
            ).catch(
                reason => {
                    //this.$message.info(reason)
                }
            )
        }
    }
</script>

